home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1663 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: scsing.switch.ch!vyzynz!xmission!news
  2. From: tknarr@xmission.com  ( Todd Knarr )
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: 12 Jan 1996 01:27:30 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4d4de2$qmr@news.xmission.com>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd <4cf8hf$8fe@hopi.gate.net> <4cgq30$c0v@weck.brokersys.com> <4cvu68$2jb@macaw.cyberport.com> <4d21og$iab@news.xmission.com> <4d2ok0$69s@beach.and.nl>
  9. Reply-To: tknarr@xmission.com ( Todd Knarr )
  10. NNTP-Posting-Host: slc5.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4d2ok0$69s@beach.and.nl>, jos@and.nl (Jos A. Horsmeier) writes:
  14. >IMHO all HN tries to add to the language, is a (weak) notion of domains
  15. >of objects. I thought (but correct me if I'm wrong) that HN adds a name
  16. >prefix to an object name for the 'deeper notion' (read: the semantics or 
  17. >domain); it does not prefix every object name with a short prefix 
  18. >indicating the type used to implement the domain of an object.
  19.  
  20. The idea of a domain ( I usually refer to it as a high-level type )
  21. is one way to make HN useful. It still doesn't work, though, because
  22. of inheritance in OO languages and the idea of pointers or references
  23. to base classes. You wind up with confusion when the reference parameter
  24. has an HN prefix for base class A but the object is actually of class
  25. M which is derived from class E which is derived from class A.
  26.  
  27. Your idea of domains might be useful, but it requires first disabling
  28. all automatic type conversion between domain types even when such
  29. conversion is defined. The effects of that might be non-trivial, and
  30. go against the principle in C and C++ of "you asked for it, you got it".
  31. Since the effects can be simulated at need, at least if you start with
  32. a real class and not a built-in type, by using trivial derived classes
  33. and declaring certain constructors and conversion functions private,
  34. I'm not certain introducing your domain concept would be useful enough
  35. to offset it's disagreement with language principles.
  36.  
  37. --
  38. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  39.                                       |  Member, USENET Cabal
  40.  
  41. Seriously, I don't want to die just yet.  I don't care how
  42. good-looking they are, I! don't! want! to! die!"
  43.                                         -- Megazone ( UF1 )
  44.  
  45.